<?php $this->load->view('common/head');?>
<?php $this->load->view('common/navbar');?>
<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">专营店基本信息</div>

  <!-- Table -->
  <table class="table table-condensed">
    <tbody>
      <tr>
        <td class="bg-primary col-md-1">所属区：</td>
        <td><?php echo $storeData['region'] ?></td>
      </tr>
      <tr>
        <td class="bg-primary col-md-1">专营店：</td>
        <td><?php echo $storeData['storeName'] ?></td>
      </tr>
      <tr>
        <td class="bg-primary col-md-1">所属双月：</td>
        <td><?php echo $procData['timeUnitStr'] ?></td>
      </tr>
    </tbody>
  </table>
</div>
<form class="form-inline" name="audit" id="audit">
<input type="hidden" name="procId" id="procId" value="<?=$procData['id']?>">
<?php $this->load->view('CarProject/budgetList', $this->viewData); ?>
<div style="border: 1px solid #fff; width: 95%;margin: 0 auto;" id="detail">
</div>
<script type="text/javascript">
  $(function(){
    <?php $projectList = array_values($projectList); ?>
    $("#detail").load('<?=printUrl('CarProject','budgetCheck');?>', {procId:<?=$projectList[0]['procId']?>,projectId:<?=$projectList[0]['id']?>});
  });
</script>
<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">预算审核</div>

  <!-- Table -->
  <table class="table table-condensed">
    <tbody>
      <tr>
        <td class="bg-primary col-md-2">审核级别：</td>
        <td><?php echo $this->user['userRoleName'] ?></td>
      </tr>
      <tr>
        <td class="bg-primary col-md-2">预算申请总费用：</td>
        <td><?php echo $isBubao ? $procData['buBudgetApply']: $procData['budgetApply'] ?></td>
      </tr>
      <tr>
        <td class="bg-primary col-md-2">审核总费用：</td>
        <td id="budgetAuditBox">0</td>
      </tr>
      <tr>
        <td class="bg-primary col-md-2">审核意见：</td>
        <td><textarea style="width: 500px; height: 100px;" class="form-control" rows="3" name="audit[auditDes]" placeholder="审核意见"></textarea></td>
      </tr>
      <tr>
        <td class="text-center" colspan="2">
          <button class="btn btn-default btn-danger" type="button" onclick="ajaxFormSubmit('audit')">提交审核</button>
          <button class="btn btn-default btn-primary" type="button" onclick="window.location.href='<?=$breadcrumb[count($breadcrumb)-2]['url']?>'" role="button">返回</button>
        </td>
      </tr>
    </tbody>
  </table>
</div>
</form>
<?php $this->load->view('common/auditList', $this->viewData); ?>
<script type="text/javascript" src="public/js/commonAudit.js"></script>
<script type="text/javascript">
  $(function(){
    $("#budgetAuditBox").html(countMoney('budgetAuditRs'));
    $(".budgetAuditRs").change(function(){
      $("#budgetAuditBox").html(countMoney('budgetAuditRs'));
    });
  });
</script>
<?php $this->load->view('common/foot');?>